<template>
    <div class="main">
		<div class ="title">
			<span>个人信息</span>
		</div>
		<div class="info">
			<van-field
				v-model="data.Name"
				label="姓名:"
				type="input"
				required
			/>
			<van-field
				v-model="data.Mobile"
				label="电话:"
				type="input"
				required
			/>
			<van-field
				v-model="data.Town"
				label="所属镇街:"
				type="input"
				required
			/>

			<eagle-input
				name="Country"
				label="所属村"
				v-model="data.Country"
				required
				:islink="true"
				readonly
				@click="CountryName()"
				placeholder="请选择所属村"
			></eagle-input>

			<van-field
				v-model="data.Adress"
				label="门牌地址:"
				type="input"
				required
			/>
			<van-field
				v-model="data.Native"
				label="籍贯:"
				type="input"
			/>
			<van-field
				v-model="data.Company"
				label="单位:"
				type="input"
			/>
			<van-field
				v-model="data.Occupation"
				label="职业:"
				type="input"
			/>
		</div>

		<!--检查类型-->
		<check-type-dialog
			v-model="show"
			:data="data"
			@close="closeCountry"
		></check-type-dialog>

		<div class="bottom_submit">
			<van-button class="button" type="primary" @click="_submit()" >确 定</van-button>
		</div>
    </div>
</template>
<script>
import checkTypeDialog from "@/views/chs/chsReport/checkTypeDialog.vue";
export default {
	components: {
    checkTypeDialog,
  },
	data() {
		return {
			data: {
				Name:"",
				Mobile:"",
				Town:"茶山镇",
				Country:"",
				Adress:"",
				CountryList:[
					{ID: "茶山村", Name: "茶山村"},
					{ID: "茶山圩", Name: "茶山圩"},
					{ID: "下朗村", Name: "下朗村"},
					{ID: "横江村", Name: "横江村"},
					{ID: "京山村", Name: "京山村"},
					{ID: "塘角村", Name: "塘角村"},
					{ID: "南社村", Name: "南社村"},
					{ID: "冲美村", Name: "冲美村"},
					{ID: "博头村", Name: "博头村"},
					{ID: "增埗村", Name: "增埗村"},
					{ID: "卢边村", Name: "卢边村"},
					{ID: "寒溪水村", Name: "寒溪水村"},
					{ID: "上元村", Name: "上元村"},
					{ID: "刘黄村", Name: "刘黄村"},
					{ID: "孙屋村", Name: "孙屋村"},
					{ID: "粟边村", Name: "粟边村"},
					{ID: "超朗村", Name: "超朗村"},
					{ID: "茶溪社区工业园", Name: "茶溪社区工业园"}
				],
			},
			show:false,
		}
	},
	created() {
	},

	methods: {

		// 提交数据
		_submit(){
			if(this.data.Name == null || this.data.Name == ""){
				return this.$toast('请输入姓名');
			}
			if(this.data.Mobile == null || this.data.Mobile == ""){
				return this.$toast('请输入电话');
			}
			if(this.data.Town == null || this.data.Town == ""){
				return this.$toast('请输入所属镇街');
			}
			if(this.data.Country == null || this.data.Country == ""){
				return this.$toast('请选择所属村');
			}
			if(this.data.Adress == null || this.data.Adress == ""){
				return this.$toast('请填写门牌地址');
			}
            this.$router.push({
                path: "/chsReport/FirstType",
                query: {
                    Info: this.data,
                },
            });
        },

		// 选择所属村
		CountryName() {
			this.show = true;
		},

		// 关闭弹框
		closeCountry(type) {
			if (type) {
				this.data.Country = type;
			}
			this.show = false;
		},
	},
}
</script>

<style lang="less" scoped>
.title{
	height: 30px;
	font-size: 20px;
	text-align: center;
	margin-top: 15px;
	margin-bottom: 15px;
}
.van-field__label {
    -webkit-box-flex: 0;
    -webkit-flex: none;
    flex: none;
    box-sizing: border-box;
    width: 50px;
    margin-right: 0.32rem;
    color: #646566;
    text-align: left;
    word-wrap: break-word;
}
.info{
	margin-left: 5px;
	margin-right: 5px;
	border-radius: 20px;
}
.bottom_submit{
	width: 100%;
	margin-top: 10px;
	text-align: center;
}
.button{
	width: 98%;
}
</style>
